import { ref, computed, onMounted } from 'vue'
export default function () {
  const x = ref(0)
  const y = ref(0)

  const divClick = (e: MouseEvent) => {
    console.log(e);
    x.value = e.offsetX
    y.value = e.offsetY
  }

  const total = computed(() => {
    return x.value + y.value
  })

  onMounted(() => {
    console.log('初始化');
  })

  return { x, y, divClick, total }
}